#include "stdio.h"
#include "Cfunc.h"

void display(char* str)
{
  	printf("%s\n", str);
}
  

double fadd(float f1, float f2)
{
	printf("%f + %f = %f\n", f1, f2, f1+f2);
  	return f1 + f2;
}


int iadd(int f1, int f2)
{
	printf("%d + %d = %d\n", f1, f2, f1+f2);
  	return f1 + f2;
}


/*
typedef struct __data_struct_type
{
	char c;
	char c_buf[64];
	char* c_ptr;
	int i;
	unsigned int ui;
	long li;
	unsigned long uli;
	float f;
	double lf;
	void* vp;
}DATST_TYPE;
*/
void display_datst_arg(struct __data_struct_type ds)
{
	printf("char type: %c\n", ds.c);
	printf("char buffer type: %s\n", ds.c_buf);
	printf("char pointer type: %s\n", ds.c_ptr);
	printf("integer type: %d\n", ds.i);
	printf("unsigned integer type: %d\n", ds.ui);
	printf("long integer type: %d\n", ds.li);
	printf("unsigned long integer type: %d\n", ds.uli);
	printf("float type: %f\n", ds.f);
	// double类型输入只能使用%lf, 输出可以使用%f
	printf("double type: %f\n", ds.lf);
	//printf("void pointer type: %s\n", (char*)ds.vp);
	//ds.func();
}

void display_datst_ptr_arg(struct __data_struct_type* ds)
{
	printf("char type: %c\n", ds->c);
	printf("char buffer type: %s\n", ds->c_buf);
	printf("char pointer type: %s\n", ds->c_ptr);
	printf("integer type: %d\n", ds->i);
	printf("unsigned integer type: %d\n", ds->ui);
	printf("long integer type: %d\n", ds->li);
	printf("unsigned long integer type: %d\n", ds->uli);
	printf("float type: %f\n", ds->f);
	// double类型输入只能使用%lf, 输出可以使用%f
	printf("double type: %f\n", ds->lf);
	//printf("void pointer type: %s\n", (char*)ds.vp);
	//ds->func();
}